<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目评审流程附加信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
	<form id="formSet1">
		<div class="fieldset1 tabel_col clearFix">
			<div class="caption">
				<span class="title">项目发起人信息</span>
			</div>
			<div class="fieldBox col_33">
				<div class="label">金融顾问</div>
				<div class="field">
				<c:if test="${isDetail==0 }">
					<a href="javascript:toMgrPrjBscInfoPage()" class="sq-button-hasicon link">
					<i class="sqBtnIco_1"></i>
					</a>
					&nbsp;&nbsp;
				</c:if>
					<span name="cstMgrNm" id="cstMgrNm">&nbsp;</span>
				<input type="hidden" name="cstMgrId" id="cstMgrId" />
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">联系方式</div>
				<div class="field">
					<span name="mp" id="mp">${mp }&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">所属机构</div>
				<div class="field">
					<span name="cstMgrOrgCdNm" id="cstMgrOrgCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="caption">
				<span class="title">承租人信息</span>
			</div>
			<div class="fieldBox col_33">
				<div class="label">承租人姓名</div>
				<div class="field">
					<c:if test="${isDetail==0 && cstTypCd==1}">
						<a href="javascript:toRePrjPage('reCstNm','cstNm')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
						</a>
					</c:if>
					<c:if test="${isDetail==0 && cstTypCd==2}">
						<a href="javascript:toRePrjPage('reWorkPlc','cstNm')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
						</a>
					</c:if>
					&nbsp;&nbsp;
					<a href="javascript:showCustomerDetail()" class="link">
						<span name="cstNm" id="cstNm">&nbsp;</span>
					</a>
					<input type="hidden" id="cstId" name="cstId">
					<input type="hidden" id="cstTypCd" name="cstTypCd">
				</div>
			</div>
			<!-- 自然人客户显示字段 -->
			<c:if test="${cstTypCd==1 }">
				<div class="fieldBox col_33">
					<div class="label">身份证号码</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reCertNo','certNo')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="certNo" id="certNo">&nbsp;</span>
					</div>
				</div>
				<div class="fieldBox col_33">
					<div class="label">年龄</div>
					<div class="field">
						<span name="age" id="age">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_33">
					<div class="label">电话</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reMp1','mp1')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="mp1" id="mp1">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_66">
					<div class="label">身份证地址</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reIdAddr','idAddr')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="idAddr" id="idAddr">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_66">
					<div class="label">通讯地址</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('rePostAddr','postAddr')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="postAddr" id="postAddr">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_33">
					<div class="label">工作单位</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reWorkPlc','workPlc')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="workPlc" id="workPlc">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_66">
					<div class="label">单位地址</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reWorkAddr','workAddr')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="workAddr" id="workAddr">&nbsp;</span>
					</div>
				</div>
				<div class="fieldBox col_33">
					<div class="label">婚姻状况</div>
					<div class="field">
						<span name="marStsCdNm" id="marStsCdNm">&nbsp;</span>
					</div>
				</div>
				<div class="fieldBox col_33">
					<div class="label">配偶姓名</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reCstNm','rlNm_mate')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="rlNm_mate" id="rlNm_mate">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_33">
					<div class="label">配偶电话</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reMp1','mp_mate')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="mp_mate" id="mp_mate">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_33">
					<div class="label">配偶工作单位</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reWorkPlc','workPlc_mate')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="workPlc_mate" id="workPlc_mate">&nbsp;</span>
					</div>
				</div>
			</c:if>
			<!-- 法人显示字段 -->
			<c:if test="${cstTypCd==2 }">
				<div id="" class="fieldBox col_33">
					<div class="label">法人代表</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reCstNm','corpRep')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="corpRep" id="corpRep">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_33">
					<div class="label">法人电话</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('reMp1','corpMp')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="corpMp" id="corpMp">&nbsp;</span>
					</div>
				</div>
				<div id="" class="fieldBox col_100">
					<div class="label">通讯地址</div>
					<div class="field">
						<c:if test="${isDetail==0 }">
							<a href="javascript:toRePrjPage('rePostAddr','postAddr_corp')" class="sq-button-hasicon link">
							<i class="sqBtnIco_1"></i>
							</a>
							&nbsp;&nbsp;
						</c:if>
						<span name="postAddr_corp" id="postAddr_corp">&nbsp;</span>
					</div>
				</div>
			</c:if>
			<div class="caption">
				<span class="title">担保人</span>
			</div>
			<div id="guarantor" class="fieldBox col_100">
		        <div class="sqPanel">
		            <div class="sqPanel_body">
		                <div id="ligergrid_guarantor" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
			<div class="caption">
				<span class="title">紧急联系人</span>
			</div>
			<div id="guarantor" class="fieldBox col_100">
		        <div class="sqPanel">
		            <div class="sqPanel_body">
		                <div id="ligergrid_rl" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
			<div class="caption">
				<span class="title">融资方案</span>
			</div>
			<div class="fieldBox col_33">
				<div class="label">合同编号</div>
				<div class="field">
					<a href="javascript:toPrjDetail()" class="link">
						<span name="lsCntNo" id="lsCntNo">&nbsp;</span>
					</a>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">项目类型</div>
				<div class="field">
					<span name="prjTypCdNm" id="prjTypCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">金融产品名称</div>
				<div class="field">
					<span name="prpsCfgNm" id="prpsCfgNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">合同总金额</div>
				<div class="field">
					<span name="contAmt" id="contAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">融资总金额</div>
				<div class="field">
					<span name="actLsAmt" id="actLsAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">附加费用合计</div>
				<div class="field">
					<span name="additionAmt" id="additionAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">首付比例</div>
				<div class="field">
					<span name="firstFeePct" id="firstFeePct">&nbsp;</span>%
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">咨询费1</div>
				<div class="field">
					<span name="consultFeeAmt" id="consultFeeAmt">&nbsp;</span>
					(
					<span name="consultFeePct" id="consultFeePct">&nbsp;</span>
					%)
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">咨询费2</div>
				<div class="field">
					<span name="consultFeeAmt1" id="consultFeeAmt1">&nbsp;</span>
					(
					<span name="consultFeePct1" id="consultFeePct1">&nbsp;</span>
					%)
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">咨询费2计算基数</div>
				<div class="field">
					<span name="consultFee2CalBaseCdNm" id="consultFee2CalBaseCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33" style="display: none">
				<div class="label">客户保证金</div>
				<div class="field">
					<span name="assureFeeAmt" id="assureFeeAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">贷款期限</div>
				<div class="field">
					<span name="lsPd" id="lsPd">&nbsp;</span>
					<span name="lsPdUntCdNm" id="lsPdUntCdNm">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">租赁年利率</div>
				<div class="field">
					<span name="annIntRatePct" id="annIntRatePct">&nbsp;</span>%
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">GPS费</div>
				<div class="field">
					<span name="gps" id="gps">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">月供</div>
				<div class="field">
					<span name="eachEstRntAmt" id="eachEstRntAmt">&nbsp;</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">残值比例</div>
				<div class="field">
					<span name="residualFeePct" id="residualFeePct">&nbsp;</span>%
				</div>
			</div>
			<div class="caption">
		        <span class="title">项目产品信息</span>
		    </div>
		    <div id="car0" class="fieldBox col_100">
		        <div class="sqPanel">
		            <!-- <div class="sqPanel_head inL">
		                <span>乘用车</span>
		            </div> -->
		            <div class="sqPanel_body">
		                <div id="ligergrid_fee_car" class="sq-grid"></div>
		            </div>
		        </div>
		    </div>
		    <div class="caption">
				<span class="title">信审意见</span>
			</div>
			<div class="fieldBox col_33">
				<div class="label">是否新单</div>
				<div class="field">
					<select name="isNew" id="isNew" data-value=" " validate ="{required:true,select:true}">
						<option value=" " checked >请选择</option>
						<c:forEach items="${yesOrNoCdList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
					<span class="requiredSymbol">*</span>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">贷前风险标记</div>
				<div class="field">
					<select name="preLoanRiskFlagCd" id="preLoanRiskFlagCd" data-value=" " validate ="{required:true,select:true}">
						<option value=" " checked >请选择</option>
						<c:forEach items="${preLoanRiskFlagCdList }" var="kv">
							<option value="${kv.key }">${kv.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<c:if test="${cstTypCd==1 }">
				<div class="fieldBox col_33">
					<div class="label">本外地</div>
					<div class="field">
						<input name="localOrNo" id="localOrNo" type="text" class="ui-textbox" value="" >
					</div>
				</div>
				<div class="fieldBox col_33">
					<div class="label">行业类别</div>
					<div class="field">
						<select name="industryTypeCd" id="industryTypeCd" data-value=" ">
							<option value=" " checked >请选择</option>
							<c:forEach items="${industryTypeCdList }" var="kv">
								<option value="${kv.key }">${kv.value }</option>
							</c:forEach>
						</select>
					</div>
				</div>
			</c:if>
			<div class="fieldBox col_100">
				<div class="label" role="textclip">承租人</div>
				<div class="field">
					<textarea name="cstOpn" id="cstOpn" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
				</div>
			</div>
			<div class="fieldBox col_100" id="auditOthInfoDIV">
	            <div class="sqPanel">
	                <div class="sqPanel_head inL">
	                    <div class="btnsBox inLC">
		                    <c:if test="${isDetail==0 }">
		                        <span id="addBtn" class="sq-button sq-button-round">添加</span>
		                        <span id="delBtn" class="sq-button sq-button-round">删除</span>
	                        </c:if>
	                    </div>
	                    <span>其他信息</span>
	                </div>
	                <div class="sqPanel_body">
	                    <div id="ligergrid_audit" class="sq-grid"></div>
	                </div>
	            </div>
	        </div>
			<!-- <div class="fieldBox col_100">
				<div class="label" role="textclip">担保人</div>
				<div class="field">
					<textarea name="guaOpn" id="guaOpn" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label" role="textclip">联系人</div>
				<div class="field">
					<textarea name="ugRlOpn" id="ugRlOpn" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
				</div>
			</div> -->
			<%-- <c:if test="${cstTypCd==1 }">
				<div class="fieldBox col_100">
					<div class="label" role="textclip">房产证明</div>
					<div class="field">
						<textarea name="houseCret" id="houseCret" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
					</div>
				</div>
			</c:if> --%>
			<c:if test="${cstTypCd==2 }">
				<div class="fieldBox col_100">
					<div class="label" role="textclip">公司详情</div>
					<div class="field">
						<textarea name="companyDetail" id="companyDetail" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label" role="textclip">财务报表</div>
					<div class="field">
						<textarea name="financialState" id="financialState" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label" role="textclip">人行征信及三方</div>
					<div class="field">
						<textarea name="tripartite" id="tripartite" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
					</div>
				</div>
			</c:if>
			<!-- <div class="fieldBox col_100">
				<div class="label" role="textclip">流水</div>
				<div class="field">
					<textarea name="wasteBook" id="wasteBook" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
				</div>
			</div> -->
			<div class="fieldBox col_100">
				<div class="label" role="textclip">其他</div>
				<div class="field">
					<textarea name="otherInfo" id="otherInfo" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label" role="textclip">风险分析</div>
				<div class="field">
					<textarea name="riskOpn" id="riskOpn" rows="1" class="ui-textarea l-textarea" style="width:90%"></textarea>
				</div>
			</div>
			<c:if test="${isMdfQuatPrps==1 }">
				<div class="fieldBox col_33">
					<div class="label">项目信息</div>
					<div class="field">
						<a href="javascript:toPrjDetailModifyPage()" class="link">
							<span class="requiredSymbol">修改</span>
						</a>
					</div>
				</div>
			</c:if>
			<c:if test="${isDetail==0 }">
				<div class="fieldBox col_33">
					<div class="label">客户信息</div>
					<div class="field">
						<a href="javascript:toCstModifyPage()" class="link">
							<span class="requiredSymbol">修改</span>
						</a>
					</div>
				</div>
			</c:if>
			<div class="fieldBox col_33">
				<div class="label">资信</div>
				<div class="field">
					<a href="javascript:toPrjDetailInvestRptPage()" class="link">
						<span >获取</span>
					</a>
				</div>
			</div>
			<div class="fieldBox col_33">
				<div class="label">支付表</div>
				<div class="field">
					<a href="javascript:toPrjPrdDtlPage()" class="link">
						<span >查看</span>
					</a>
				</div>
			</div>
			<c:if test="${isDetail==0 }">
			<div class="fieldBox col_33">
				<div class="label">人行征信及三方</div>
				<div class="field">
					<a href="javascript:toTripartitePage()" class="link">
						<span >获取</span>
					</a>
				</div>
			</div>
			<div class="fieldBox col_100">
				<div class="label">旧车评估报告</div>
				<div class="field">
					<span id="oldcar">
						<a href="javascript:toOldPrdReportPage()" class="link">
							<span>获取</span>
						</a>
					</span>
				</div>
			</div>
			</c:if>
			<c:if test="${isDetail==0 }">
				<div class="fieldBox col_100">
					<div class="label">征信前置</div>
					<div class="field">
						<a href="javascript:showCreditPrepositionByCertNo()" class="link">
							点击查看
						</a>
					</div>
				</div>
			</c:if>
			<c:if test="${showCreditResult=='1' && prjTypCd=='GHKD' }">
				<c:if test="${sendStatus=='success' }">
					<div class="fieldBox col_33">
						<div class="label">征信查询结果</div>
						<div class="field">
						    <span>
						    	<c:if test="${auditResult=='pending' }">待处理</c:if>
								<c:if test="${auditResult=='pass' }">通过</c:if>
								<c:if test="${auditResult=='reject' }">拒绝/驳回</c:if>
								<c:if test="${auditResult=='quit' }">放弃/退出</c:if>
								<c:if test="${auditResult=='unknown' }">其他/未知</c:if>
						    </span>
						</div>
					</div>
				</c:if>
                <c:if test="${sendStatus!='success' }">
                	<div class="fieldBox col_33">
						<div class="label">提交征信结果</div>
						<div class="field">
							<span>${sendStatusNm }</span>
							<a href="javascript:submitCredit()" class="link">
		                    	<span>提交征信</span>
							</a>
						</div>
					</div>
                </c:if>
			</c:if>
			<div class="fieldBox col_100">
				<div class="label">通过意见链接</div>
				<div class="field">
				<a href="<%=path%>/project/audit/toCarBizAdditionalInfoPage.do?isDetail=1&projectId=${projectId}&processInstanceId=${proIntId}" target="_blank" class="link">
					/project/audit/toCarBizAdditionalInfoPage.do?isDetail=1&projectId=${projectId}&processInstanceId=${proIntId}
				</a>
				</div>
			</div>
		</div>
		<div class="btnsBox">
			<c:if test="${isDetail==0 }">
				<sys:funcAuth resCd="addCreditInfo">
					<span id="saveBtn1" class="sq-button sq-button-round" onclick="addCreditInfo();">保存至信审基础台账</span>
				</sys:funcAuth>
				<sys:funcAuth resCd="addAudRejectOpinion">
		        	<span id="ccc" class="sq-button sq-button-round" onclick="toCreditRejectOpinionAdd();">信审驳回意见</span>
				</sys:funcAuth>
			</c:if>
			<span id="prjFileInfo" class="sq-button sq-button-round" onclick="toPrjFileInfo();">项目资料信息</span>
	        <input name="creditInfoId" id="creditInfoId" type="hidden" value="">
	    </div>
	</form>
</div>
<script type="text/javascript">
var _projectId = '${projectId}';//项目ID
var _proIntId = '${proIntId}';//流程实例ID
var _taskId = '${taskId}';//任务节点ID
var _taskDefKey = '${taskDefKey}';//任务节点KEY
var _taskNm = '${taskNm}';//节点名称
var isDetail = '${isDetail}';
var ctrlKey = '${ctrlKey}';
var isGetReport = '${isGetReport}';//获取报告标识
var _cstTypCd = '${cstTypCd}';
// 信审初审节点flag
var fromCAFlag = '${fromCAFlag}';

var mainData;//信审整体资料信息

var carGrid;

var guarantorGrid;
var rlGrid;
var auditGrid;

$(function () {
	$('#formSet1').ligerForm({
        validate : true
	});
	initPrjInfo();//初始化项目相关详情信息
	initGuarantorList();//初始化担保人列表
	initRlList();//初始化紧急联系人列表
	initCreditData();//初始化信审整体资料信息
	if(isDetail==1){
		disableFixedFiled();//禁用固定标签
	}
	initCarList();//初始化乘用车车产品列表
	initAuditGrid();
	SetIframe_height();
	$("#addBtn").click(function (event) {
		auditGrid.addRow({
        	field: '',
        	fieldContent: ''
        });
    });
	$("#delBtn").click(function (event) {
        var selectedRows = auditGrid.getSelectedRows();
        if(selectedRows.length == 0){
			$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_MORE_ROW , SQ_type: "warning" });
			return;
		}
        auditGrid.deleteSelectedRow();
    });
});
var fieldJSON = [];
<c:if test="${cstTypCd==1 }">
	fieldJSON = [
		{"key":"guaOpn","value":"担保人"},
		{"key":"ugRlOpn","value":"联系人"},
		{"key":"houseCret","value":"房产证明"},
		{"key":"wasteBook","value":"流水"}
	];
</c:if>
<c:if test="${cstTypCd!=1 }">
	fieldJSON = [
		{"key":"guaOpn","value":"担保人"},
		{"key":"ugRlOpn","value":"联系人"},
		{"key":"wasteBook","value":"流水"}
	];
</c:if>
function initAuditGrid(){
	auditGrid = $("#ligergrid_audit").ligerGrid({
        url: '<%=path%>/audit/audCreditInfo/initAudCreditInfo.do?projectId=${projectId}&proIntId=${proIntId}',
        method: 'get',
        columns: [
            {display: '类别', name: 'field', width: 100,
                editor: {
                    type: 'select',
                    data: fieldJSON,
                    valueField: 'key',
                    textField: 'value'
                },
                valueField: 'field',
                textField: 'fieldNm',
                render: function (item) {
                    return item.fieldNm;
                }
            },
            {display: '内容', name: 'fieldContent', minWidth: 80, editor: {type: 'text'},align: 'left'},
        ],
        onBeforeSubmitEdit: function (e) {
        },
        onBeforeEdit: function (e) {
        	if(isDetail==1){
	        	e.column.editor.readonly=true;
        	}
        },
        usePager: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: true,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false,
        hideCheckAll: true, //隐藏全选checkbox
    });
}

function toAuditOpn(){
	//window.location.href='/project/audit/toAdditionalInfoPage.do?isDetail=1&projectId=${projectId}&processInstanceId=${proIntId}';
	window.open('<%=path%>/project/audit/toAdditionalInfoPage.do?isDetail=1&projectId=${projectId}&processInstanceId=${proIntId}');
}

//请求项目相关展示数据(参数:项目ID)
function initPrjInfo(){
	if(!_projectId){
		return;
	}
   	var _url = '<%=path%>/project/audit/getProjectInfoByPrjId.do';
	$.ajax({
   		type: 'get',
   		dataType:'json',
   		data:{
   			projectId:_projectId
   		},
   		url: _url,
   		success:function(msg){
			if(msg.success == 1){
				setPrjInfoData(msg.data);//设置数据
			}else{
				top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			}
		}
	});
}
var _certNo;
function setPrjInfoData(data){
	/**项目基本信息*/
	var prjBscinfoVO = data.prjBscinfoVO;
	if(prjBscinfoVO){
		//$("#prjNm").html(prjBscinfoVO.prjNm);
		$("#prjTypCdNm").html(prjBscinfoVO.prjTypCdNm);
		//$("#bizTypCdNm").html(prjBscinfoVO.bizTypCdNm);
		//$("#agntTypCdNm").html(prjBscinfoVO.agntTypCdNm);
		$("#lsCntNo").html(prjBscinfoVO.lsCntNo);
		//$("#bizResCdNm").html(prjBscinfoVO.bizResCdNm);
		$("#cstMgrNm").html(prjBscinfoVO.cstMgrNm);
		$("#cstMgrOrgCdNm").html(prjBscinfoVO.cstMgrOrgCdNm);
		$("#cstNm").html(prjBscinfoVO.cstNm);
		$("#cstMgrId").val(prjBscinfoVO.cstMgrId);
	}
	/**承租人信息*/
	var cstBscInfoVO = data.cstBscInfoVO;
	_certNo = cstBscInfoVO.certNo;
	if(cstBscInfoVO){
		$("#cstId").val(cstBscInfoVO.id);
		$("#cstTypCd").val(cstBscInfoVO.cstTypCd);
		if(cstBscInfoVO.cstTypCd==CustomerConstant.CST_TYPE_NP_CD){//自然人
			var cstNpBscInfoVO = cstBscInfoVO.cstNpBscInfoVO;
			if(cstNpBscInfoVO){
				$("#certNo").html(cstBscInfoVO.certNo);
				$("#age").html(cstNpBscInfoVO.age);
				$("#marStsCdNm").html(cstNpBscInfoVO.marStsCdNm);
				if(StringUtils.isNotEmpty(cstNpBscInfoVO.mp1)){
					$("#mp1").html(cstNpBscInfoVO.mp1);
				}else if(StringUtils.isNotEmpty(cstNpBscInfoVO.mp2)){
					$("#mp1").html(cstNpBscInfoVO.mp2);
				}
				$("#idAddr").html(cstNpBscInfoVO.idAddr);
				if(isDetail==0 && StringUtils.isEmpty(cstNpBscInfoVO.idAddr)){
					$("#idAddr").siblings().remove();
				}
				$("#postAddr").html(cstNpBscInfoVO.postAddr);
				if(isDetail==0 && StringUtils.isEmpty(cstNpBscInfoVO.postAddr)){
					$("#postAddr").siblings().remove();
				}
				$("#workPlc").html(cstNpBscInfoVO.workPlc);
				if(isDetail==0 && StringUtils.isEmpty(cstNpBscInfoVO.workPlc)){
					$("#workPlc").siblings().remove();
				}
				$("#workAddr").html(cstNpBscInfoVO.workAddr);
				if(isDetail==0 && StringUtils.isEmpty(cstNpBscInfoVO.workAddr)){
					$("#workAddr").siblings().remove();
				}
				var cstNpSocialRlVO = cstNpBscInfoVO.cstNpSocialRlVO;
				if(cstNpSocialRlVO){
					$("#rlNm_mate").html(cstNpSocialRlVO.rlNm);
					if(isDetail==0 && StringUtils.isEmpty(cstNpSocialRlVO.rlNm)){
						$("#rlNm_mate").siblings().remove();
					}
					$("#mp_mate").html(cstNpSocialRlVO.mp);
					if(isDetail==0 && StringUtils.isEmpty(cstNpSocialRlVO.mp)){
						$("#mp_mate").siblings().remove();
					}
					$("#workPlc_mate").html(cstNpSocialRlVO.workPlc);
					if(isDetail==0 && StringUtils.isEmpty(cstNpSocialRlVO.workPlc)){
						$("#workPlc_mate").siblings().remove();
					}
				}else{
					$("#rlNm_mate").siblings().remove();
					$("#mp_mate").siblings().remove();
					$("#workPlc_mate").siblings().remove();
				}
			}
		}else if(cstBscInfoVO.cstTypCd==CustomerConstant.CST_TYPE_CORP_CD){//法人
			var cstCorpBscInfoVO = cstBscInfoVO.cstCorpBscInfoVO;
			if(cstCorpBscInfoVO){
				$("#postAddr_corp").html(cstCorpBscInfoVO.postAddr);
				if(isDetail==0 && StringUtils.isEmpty(cstCorpBscInfoVO.postAddr)){
					$("#postAddr_corp").siblings().remove();
				}
				var cstCorpTeamVO = cstCorpBscInfoVO.cstCorpTeamVO;
				if(cstCorpTeamVO){
					$("#corpRep").html(cstCorpTeamVO.mnm);
					if(StringUtils.isNotEmpty(cstCorpTeamVO.mp1)){
						$("#corpMp").html(cstCorpTeamVO.mp1);
					}else if (StringUtils.isNotEmpty(cstCorpTeamVO.mp2)){
						$("#corpMp").html(cstCorpTeamVO.mp2);
					}
				}
			}
		}
	}
	/**报价方案信息*/
	var prjQuatPrpsVO = data.prjQuatPrpsVO;
	if(prjQuatPrpsVO){
		$("#prpsCfgNm").html(prjQuatPrpsVO.prpsCfgNm);
		$("#contAmt").html(prjQuatPrpsVO.contAmt);
		$("#annIntRatePct").html(prjQuatPrpsVO.annIntRatePct);
		//$("#intRateRsPct").html(prjQuatPrpsVO.intRateRsPct);
		$("#actLsAmt").html(prjQuatPrpsVO.actLsAmt);
		$("#lsPd").html(prjQuatPrpsVO.lsPd);
		$("#lsPdUntCdNm").html(prjQuatPrpsVO.lsPdUntCdNm);
		//$("#expHdlWayCdNm").html(prjQuatPrpsVO.expHdlWayCdNm);
		//$("#payWayCdNm").html(prjQuatPrpsVO.payWayCdNm);
		//$("#irrPct").html(prjQuatPrpsVO.irrPct);
		$("#eachEstRntAmt").html(prjQuatPrpsVO.eachEstRntAmt);
	}
	/**费用相关*/
	/* if(data.firstFeeAmt){
		$("#firstFeeAmt").text(FormatMoney(parseFloat(data.firstFeeAmt)));//首期租金
	} */
	$("#firstFeePct").html(data.firstFeePct);//首期比例
	if(data.assureFeeAmt){
		$("#assureFeeAmt").text(FormatMoney(parseFloat(data.assureFeeAmt)));//保证金
	}
	//$("#assureFeePct").html(data.assureFeePct);//保证金比例
	if(data.consultFeeAmt1!=null){
		$("#consultFeeAmt1").text(FormatMoney(parseFloat(data.consultFeeAmt1)));//咨询费2
	}
	$("#consultFeePct1").html(data.consultFeePct1);//咨询费2 比例
	$("#consultFee2CalBaseCdNm").html(data.consultFee2CalBaseCdNm);//咨询费2 计算基数
	
	if(data.consultFeeAmt!=null){
		$("#consultFeeAmt").text(FormatMoney(parseFloat(data.consultFeeAmt)));//咨询费1
	}
	$("#consultFeePct").html(data.consultFeePct);//咨询费1 比例
	
	/* if(data.purchaseFeeAmt!=null){
		$("#purchaseFeeAmt").text(FormatMoney(parseFloat(data.purchaseFeeAmt)));//留购价
	} */
	/* if(data.insAssureFeeAmt!=null){
		$("#insAssureFeeAmt").text(FormatMoney(parseFloat(data.insAssureFeeAmt)));//保险保证金
	} */
	if(data.gps!=null){
		$("#gps").text(FormatMoney(parseFloat(data.gps))); //GPS
	}
	if(data.additionAmt!=null){
		$("#additionAmt").text(FormatMoney(parseFloat(data.additionAmt))); //附加费用合计
	}
	$("#residualFeePct").html(data.residualFeePct);//残值比例
	
}
//初始化担保人列表
function initGuarantorList(){
	if(!_projectId)return;
	guarantorGrid = $("#ligergrid_guarantor").ligerGrid({
        url: '<%=path%>/project/audit/initGuarantorList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
        	cstRlTyp:ProjectConstant.CST_RL_SPONSOR
        },
        columns: [
            {display: '担保人姓名', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h ='';
            		if(isDetail==0 && _cstTypCd==1){
                    	h+='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                    	h+="'"+"reCstNm"+"','"+rowdata.cstNm+"')";
                    	h+='"><i class="sqBtnIco_1"></i></a>';
                    	h+='&nbsp;&nbsp;&nbsp;&nbsp;';
                    }
                    if(isDetail==0 && _cstTypCd==2){
                    	h+='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                    	h+="'"+"reCstNm"+"','"+rowdata.cstNm+"')";
                    	h+='"><i class="sqBtnIco_1"></i></a>';
                    	h+='&nbsp;&nbsp;&nbsp;&nbsp;';
                    }
            		h+='<a href="javascript:toGuarantorDetail(';
                    h+=rowdata.id;
                    h+=","+rowdata.cstTypCd;
                    h+=')">'+rowdata.cstNm+'</a>';
                return h;
            	}	
            },
            {display: '担保人身份证号', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.certNo)){
            			if(isDetail==0 ){
                        	h='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                        	h+="'"+"reCertNo"+"','"+rowdata.certNo+"')";
                        	h+='"><i class="sqBtnIco_1"></i></a>';
                        	h+='&nbsp;&nbsp;&nbsp;&nbsp;';
                        	h+=rowdata.certNo;
                        }else{
                        	h = ''+rowdata.certNo+''; 
                        }
            		}
            		return h;
            	}
            },
            {display: '联系方式', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h = '';
            		if(rowdata.cstNpBscInfoVO){
            			var cstNpBscInfoVO = rowdata.cstNpBscInfoVO;
            			if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.mp1)){
            				h = '' + cstNpBscInfoVO.mp1 + '';
            			}else if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.mp2)){
            				h = '' + cstNpBscInfoVO.mp2 + '';
            			}
            		}else if(rowdata.cstCorpBscInfoVO){
            			var cstCorpBscInfoVO = rowdata.cstCorpBscInfoVO;
            			if(cstCorpBscInfoVO && StringUtils.isNotEmpty(cstCorpBscInfoVO.officeTel)){
            				h = '' + cstCorpBscInfoVO.officeTel + '';
            			}
            		}
            		if(isDetail==0 && StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"reMp1"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
                	return h;
            	}	
            },
            {display: '联系地址', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h = '';
            		if(rowdata.cstNpBscInfoVO){
            			var cstNpBscInfoVO = rowdata.cstNpBscInfoVO;
            			if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.homeAddr)){
            				h = '' + cstNpBscInfoVO.homeAddr + '';
            			}
            		}else if(rowdata.cstCorpBscInfoVO){
            			var cstCorpBscInfoVO = rowdata.cstCorpBscInfoVO;
            			if(cstCorpBscInfoVO && StringUtils.isNotEmpty(cstCorpBscInfoVO.officeAddr)){
            				h = '' + cstCorpBscInfoVO.officeAddr + '';
            			}
            		}
            		if(isDetail==0 && StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"rePostAddr"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
                	return h;
            	}	
            },
            {display: '担保人婚姻状况', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.marStsCdNm)){
            			h = ''+rowdata.cstNpBscInfoVO.marStsCdNm+''; 
            		}
            		return h;
            	}
            },
            {display: '担保人配偶姓名', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.cstNpSocialRlVO)){
            			h = ''+rowdata.cstNpBscInfoVO.cstNpSocialRlVO.rlNm+''; 
            		}
            		if(isDetail==0 && StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"reCstNm"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
            		return h;
            	},
           	}
            ],
        onBeforeEdit: function (e) {},
        onBeforeShowData: function(){SetIframe_height();},
        onAfterShowData: function(){SetIframe_height();},
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}
//初始化紧急联系人列表
function initRlList(){
	if(!_projectId)return;
	rlGrid = $("#ligergrid_rl").ligerGrid({
        url: '<%=path%>/project/prjbscinfo/initPrjLinkManList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
        },
        columns: [
				{ display: '联系人姓名', name: '', minWidth: 140,
					render: function (rowdata, rowindex, value){
						var h='';
	            		if(StringUtils.isNotEmpty(rowdata.lnkNm)){
	            			if(isDetail==0 ){
	                        	h='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
	                        	h+="'"+"reCstNm"+"','"+rowdata.lnkNm+"')";
	                        	h+='"><i class="sqBtnIco_1"></i></a>';
	                        	h+='&nbsp;&nbsp;&nbsp;&nbsp;'+rowdata.lnkNm;
	                        }else{
	                        	h = ''+rowdata.lnkNm+''; 
	                        }
	            		}else{
	            			h = ''+rowdata.lnkNm+''; 
	            		}
	            		return h;
					}	
				},
				{ display: '联系电话', name: 'mp', minWidth: 100 ,
					render: function (rowdata, rowindex, value){
						var h='';
	            		if(StringUtils.isNotEmpty(rowdata.mp)){
	            			if(isDetail==0 ){
	                        	h='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
	                        	h+="'"+"reMp1"+"','"+rowdata.mp+"')";
	                        	h+='"><i class="sqBtnIco_1"></i></a>';
	                        	h+='&nbsp;&nbsp;&nbsp;&nbsp;'+rowdata.mp;
	                        }else{
	                        	h = ''+rowdata.mp+''; 
	                        }
	            		}else{
	            			h = ''+rowdata.mp+'';
	            		}
	            		return h;
					}	
				}
            ],
        onBeforeEdit: function (e) {},
        onBeforeShowData: function(){SetIframe_height();},
        onAfterShowData: function(){SetIframe_height();},
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}

//请求信审整体资料数据(参数:项目ID,流程实例ID)
function initCreditData(){
	if(!_projectId || !_proIntId){
		return;
	}
   	var _url = '<%=path%>/audit/audCreditInfo/getByProjectIdAndProIntId.do';
	$.ajax({
   		type: 'get',
   		dataType:'json',
   		data:{
   			projectId:_projectId,
   			proIntId:_proIntId
   		},
   		url: _url,
   		success:function(msg){
			if(msg.success == 1){
				setData(msg.data);//设置数据
   				mainData = msg.data;
			}else{
				top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			}
		}
	});
}
	
//设置页面数据
function setData(data){
	var form = liger.get("formSet1");
	//设置数据
	$("#creditInfoId").val(data.id);//信审整体资料ID
	$("#localOrNo").val(data.localOrNo);
	$("#cstOpn").val(data.cstOpn);
	$("#guaOpn").val(data.guaOpn);
	$("#ugRlOpn").val(data.ugRlOpn);
	$("#houseCret").val(data.houseCret);
	$("#wasteBook").val(data.wasteBook);
	$("#companyDetail").val(data.companyDetail);
	$("#financialState").val(data.financialState);
	$("#tripartite").val(data.tripartite);
	$("#otherInfo").val(data.otherInfo);
	$("#riskOpn").val(data.riskOpn);
	form.setData({
		industryTypeCd:data.industryTypeCd,
	});
	if(null!=data.isNew){
		form.setData({
			isNew:data.isNew.toString(),
		});
	}
	if(null!=data.preLoanRiskFlagCd){
		form.setData({
			preLoanRiskFlagCd:data.preLoanRiskFlagCd.toString(),
		});
	}

	//setRgnProvCdUpdataValue(data.actualAreaCd);//实际区域
	//setRegionSelectDataChange();
};
	
//保存信审整体资料信息
function addCreditInfo(){
    var form = liger.get("formSet1");
    if (!form.valid()) {
    	top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO , SQ_type: "warning" });
           return false;
       }
    var data = form.getData();
    //data["actualAreaCd"] = getRgnProvCd();//获取省代码(实际区域)
    data["projectId"] = _projectId;//项目ID
    data["proIntId"] = _proIntId;//流程实例ID
    //data["prdTypCd"] = _prdTypCd;//刷新动态字段的产品类型依据
    
    data["taskDefKey"] = _taskDefKey;//节点KEY
    data["taskNm"] = _taskNm;//节点名称
    
	data["carInfo"] = JSON.stringify(carGrid.getData());//乘用车列表信息
	
	data["auditGridJSON"] = JSON.stringify(auditGrid.getData());//信审整体资料其他信息
    
    var id = $("#creditInfoId").val();
       var url = '<%=path%>/audit/audCreditInfo/add.do';
       if(id != ""){
       	url = '<%=path%>/audit/audCreditInfo/modify.do';
       	data["id"]= id;
       }
      var wait_dialog;
    $.ajax({
		type: 'post',
		dataType:'json',
		data:data,
		url: url,
		beforeSend: function(){
	          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
	     },
		success:function(msg){
			 wait_dialog.close();
			 if(msg.success == 1){
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
				 if(msg.data){
					 $("#creditInfoId").val(msg.data);
				 }
			    if(carGrid){
			    	carGrid.reload();
			    }
			    if(auditGrid){
			    	auditGrid.reload();
			    }
			 }else{
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			 }
		}
	});
}
	
//车辆级别
var carLevelCdListJSON = [];
<c:if test="${not empty carLevelCdListJSON}"> carLevelCdListJSON = ${carLevelCdListJSON}; </c:if>

function toPrjDetailInvestRptPage(){
	if(!_projectId)return;
	Add_navTab("toPrjDetailInvestRptPage"+_projectId, "资信信息", '<%=path%>/project/prjbscinfo/toPrjDetailInvestRptPage.do?detailFlag=true&cstRlCd=1&prjId='+_projectId);
}
function toPrjPrdDtlPage(){
	if(!_projectId)return;
	Add_navTab("toPrjPrdDtlPage"+_projectId, "支付表", '<%=path%>/project/prjprddtl/toListPage.do?detailFlag=true&prjId='+_projectId);
}
function toTripartitePage(){
	if(!_projectId)return;
	Add_navTab("toTripartitePage"+_projectId, "人行征信及三方", '<%=path%>/riskctrl/rskctrl/toMainPage.do?id='+_projectId);
}
//获取旧车评估报告
function toOldPrdReportPage(){
	if(!_projectId)return;
	$("#oldcar").html("正在执行...");
	jQuery.ajax({
		type:"get",
		url:"<%=path%>/car300/infCar300Rec/toReportListPage.do?prjId="+_projectId+"&isGetReport="+isGetReport,
		success:function(vmObj){
			$("#oldcar").html(vmObj);
			if(carGrid){//重新加载设备信息
		    	carGrid.reload();
		    }
		}
	});
}

function showCreditPrepositionByCertNo(){
	if(_certNo){
	    Add_navTab("showCreditPreposition"+_certNo, "征信前置查询", '<%=path%>/riskctrl/rccstbscinfo/toBfRecListPage.do?certNo='+_certNo);
	}
}

function toPrjDetail(){
	if(!_projectId)return;
	// 信审初审节点flag
	Add_navTab("prjDetail"+_projectId, "项目信息", '<%=path%>/project/prjbscinfo/toModifyPage.do?detailFlag=true&id='+_projectId + '&fromCAFlag=' + fromCAFlag);
}
function toPrjDetailModifyPage(){
	if(!_projectId)return;
	Add_navTab("prjModify"+_projectId, "修改项目信息", '<%=path%>/project/prjbscinfo/toModifyPage.do?showTabs=tabB,tabE,tabF,tabG&detailFlag=false&id='+_projectId);
}
function toMfrDetail(_mfrId){
	if(!_mfrId || _mfrId==null || _mfrId=="null")return;
	Add_navTab("mfrDetail"+_mfrId, "项目产品厂商信息", '<%=path%>/product/mfrInfo/toDetailPage.do?id='+_mfrId);
}
function toSplDetail(_splId){
	if(!_splId || _splId==null || _splId=="null")return;
	Add_navTab("splDetail"+_splId, "项目产品供应商信息", '<%=path%>/product/splInfo/toDetailPage.do?id='+_splId);
}
function toPrdDetail(_prjPrdId){
	if(!_prjPrdId || _prjPrdId==null || _prjPrdId=="null")return;
	///project/prjprdbscinfo/toModifyPage.do?id=161031000000065&&prjId=160829000000052&&detailFlag=true
	Add_navTab("prjPrdDetail"+_prjPrdId, "项目产品详细信息", '<%=path%>/project/prjprdbscinfo/toModifyPage.do?detailFlag=true&&id=' +_prjPrdId+ '&&prjId=' +_projectId);
}

//初始化乘用车产品列表数据--car
function initCarList(){
	if(!_projectId)return;
	$("#car0").show();
	carGrid = $("#ligergrid_fee_car").ligerGrid({
        url: '<%=path%>/project/audit/initPrjPrdList.do',
        method: 'get',
        parms:{
        	prjId:_projectId,
        	proIntId:_proIntId,
        	audPrjPrdListFlag:AuditConstant.AUD_PRJ_PRD_LIST_PARAM_FOR_CAR,
        	car300:1
        },
        columns: [
            /* {display: '车辆级别', name: 'audCarInfoVO.carLevelCd', minWidth: 100,
                editor: {
                    type: 'select',
                    data: carLevelCdListJSON,
                    valueField: 'key',
                    textField: 'value'
                },
                valueField: 'audCarInfoVO.carLevelCd',
                textField: 'audCarInfoVO.carLevelCdNm',
                render: function (item) {
                    return item.audCarInfoVO.carLevelCdNm;
                }
            }, */
             {display: '供应商', minWidth: 150,align:'left',
            	render: function (rowdata, rowindex, value){
            		var h="";
            			h='<a href="javascript:toSplDetail(';
                        h+="'"+rowdata.splId+"'";
                        if(StringUtils.isNotEmpty(rowdata.splNm)){
	                        h+=')">'+rowdata.splNm+'</a>';
                        }else{
	                        h+=')"></a>';
                        }
                    return h;
            	}	
            }, 
            {display: '设备名称',align:'left', minWidth: 200,
            	render: function (rowdata, rowindex, value){
           			var h='<a href="javascript:toPrdDetail(';
                        h+="'"+rowdata.id+"'";
                        //h+=",'ligergrid_bankacc'";
                        if(StringUtils.isNotEmpty(rowdata.prdNm)){
	                        h+=')">'+rowdata.prdNm+'</a>'
                        }else{
	                        h+=')"></a>'
                        }
                    return h;
            	}	
            },
           /*  {display: '产品编码',align:'left', name: 'prdId' },
            {display: '品牌', name: 'brCdNm', minWidth: 80 }, */
            {display: '是否新车', name: 'isNewNm', width: 80 },
            {display: 'VIN', name: 'vinListStr', width: 120 ,
            	render: function (rowdata, rowindex, value){
            		var h="";
            		if(isDetail==0 && StringUtils.isNotEmpty(rowdata.vinListStr)){
            			h='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                        h+="'vin','"+rowdata.vinListStr+"'";
                        h+=')"><i class="sqBtnIco_1"></i></a>';
                        h+='&nbsp;&nbsp;&nbsp;&nbsp;'+rowdata.vinListStr;
                    }else{
                    	h = rowdata.vinListStr;
                    }
                    return h;
            	} 	
            },
            /* {display: '使用期限(月)',align:'right', name: 'usedPd', minWidth: 80 }, */
            {display: '指导价', name: 'audCarInfoVO.guidePcDouble', minWidth: 80, align: 'right',
            	editor: {type: 'number',precision:2,
                	toFix:true,
    				onToFix:function(){
    					 top.$.ligerDialog.SQalert({SQ_type: "warning",content: "小数点后面最多2位小数！"});
    				}
				}
            },
            {display: '参考售价', name: 'audCarInfoVO.peferPcDouble', minWidth: 80, align: 'right',
            	editor: {type: 'number',precision:2,
                	toFix:true,
    				onToFix:function(){
    					 top.$.ligerDialog.SQalert({SQ_type: "warning",content: "小数点后面最多2位小数！"});
    				}
				}
            },
            {
                display: '初始登记日期', name: 'audCarInfoVO.registeDate',
                editor: {type: 'date'},
                render: function (rowdata, index, value) {
                    var result = '';
                    if (StringUtils.isEmpty(value)) return result;
                    var date = new Date(value);
                    result = date.Format('yyyy-MM-dd');
                    return result;
                }
            },
            {display: '评估里程(km)', name: 'audCarInfoVO.mileage', minWidth: 80, align: 'right',
            	editor: {type: 'number'}
            },
            {display: '是否出险', name: 'infCar300RecVO.accidentType', minWidth: 80 },
            {display: '报价', align:'right',name: 'guidePc', minWidth: 80 },
            {display: '数量', name: 'prdQty', minWidth: 80 },
            /* {display: '小计', align:'right',name: 'prdAmt', minWidth: 80 }, */
            {display: '留购价', align:'right',name: 'purchaseFeeAmtSum', minWidth: 80 },
            ],
        onBeforeSubmitEdit: function (e) {
        	//alert("onbeforeSubmit");
        },
        onBeforeEdit: function (e) {
        	if(isDetail==1){
        		e.column.editor.readonly=true;
        	}else{
	        	//新车 禁用初始登记日期/里程      二手车 禁用指导价/参考售价
	        	if (e.column.columnname == "audCarInfoVO.registeDate" && e.record.isNew==1) {
	            	e.column.editor.readonly=true;
	            }else if (e.column.columnname == "audCarInfoVO.mileage" && e.record.isNew==1) {
	            	e.column.editor.readonly=true;
	            }else if (e.column.columnname == "audCarInfoVO.guidePcDouble" && e.record.isNew==0) {
	            	e.column.editor.readonly=true;
	            }else if (e.column.columnname == "audCarInfoVO.peferPcDouble" && e.record.isNew==0) {
	            	e.column.editor.readonly=true;
	            }else{
	            	e.column.editor.readonly=false;
	            }
        	}
        },
        onAfterShowData:function (data){
        	SetIframe_height();
        },
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        fixedCellHeight:false,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}

function toCreditRejectOpinionAdd(){
	var bookTypCd = AuditConstant.AUD_REJECT_BOOK_TYP_CD;//台账类型-信审驳回台账
	var opinionTypeCd = AuditConstant.SYS_FLOW_REJ_RSN_TYP_CD_PRJ;//驳回意见类型-立项驳回
	top.$.ligerDialog.SQopen({
        width: 900,
        height:500,
        top:200,
        title : '信审驳回意见',
        url:'<%=path%>/audit/audRejectOpinion/toAddPage.do?projectId='+_projectId+'&proIntId='+_proIntId+'&taskId='+_taskId+'&taskDefKey='+_taskDefKey+'&opinionTypeCd='+opinionTypeCd+'&bookTypCd='+bookTypCd+'&taskNm='+_taskNm,
        buttons: [{
	            text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
	            onclick: function (item, Dialog) {
	                if (Dialog.onOk) Dialog.onOk();
	            }
	        }, {
	            text: "关闭", type: 'cancel', cls: 'l-dialog-btn-no',
	            onclick: function (item, Dialog) {
	                if (Dialog.onCancel) Dialog.onCancel();
	            }
	        }
	    ]
    });
}
//资料
function toPrjFileInfo(){
    Add_navTab("addPrjFileInfo"+_projectId, "项目资料", '<%=path%>/project/prjFileInfo/toFileInfoListPage.do?prjId='+_projectId+'&ctrlKey='+ctrlKey);
}

//担保人详情
function toGuarantorDetail(_cstId,_cstTypCd){
	if(!_cstId || !_cstTypCd)return;
	if(_cstTypCd == 1){
		Add_navTab('tab_customer_np_detail'+_cstId,'担保人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoNpDetailPage.do?id='+_cstId);
	}else if(_cstTypCd == 2){
		Add_navTab('tab_customer_corp_detail'+_cstId,'担保人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoCorpDetailPage.do?id='+_cstId);
	}
}
//承租人详情
function showCustomerDetail(_cstId,_cstTypCd){
	var _cstId = $("#cstId").val();
	var _cstTypCd = $("#cstTypCd").val();
	if(!_cstId || !_cstTypCd)return;
	if(_cstTypCd == 1){
		Add_navTab('tab_customer_np_detail'+_cstId,'承租人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoNpDetailPage.do?id='+_cstId);
	}else if(_cstTypCd == 2){
		Add_navTab('tab_customer_corp_detail'+_cstId,'承租人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoCorpDetailPage.do?id='+_cstId);
	}
}

//修改客户信息
function toCstModifyPage(){
	var _cstId = $("#cstId").val();
	if(StringUtils.isEmpty(_cstId))return;
	Add_navTab('tab_customer_modify'+_cstId,'承租人修改','<%=path%>/customer/external/toCstModifyPage.do?id='+_cstId);
	
}

//查询项目信息(查重)
function toRePrjPage(type,value){
	var _cstId = $("#cstId").val();
	var _cstTypCd = $("#cstTypCd").val();
	if(StringUtils.isEmpty(_cstId) || StringUtils.isEmpty(_projectId) || StringUtils.isEmpty(_cstTypCd))return;
	value = $("#"+value).html();
	Add_navTab('tab_re_prj'+'-'+type+_cstId,'查重页面','<%=path%>/project/prjbscinfo/toRePrjListPage.do?id='+_cstId+'&cstTypCd='+_cstTypCd+'&prjId='+_projectId+'&type='+type+'&value='+value);
}
//查询项目信息(查重)
function toRePrjPageList(type,value){
	var _cstId = $("#cstId").val();
	var _cstTypCd = $("#cstTypCd").val();
	if(StringUtils.isEmpty(_cstId) || StringUtils.isEmpty(_projectId) || StringUtils.isEmpty(_cstTypCd))return;
	Add_navTab('tab_re_prj'+'-'+type+_cstId,'查重页面','<%=path%>/project/prjbscinfo/toRePrjListPage.do?id='+_cstId+'&cstTypCd='+_cstTypCd+'&prjId='+_projectId+'&type='+type+'&value='+value);
}
//到项目列表页（与客户经理关联）
function toMgrPrjBscInfoPage(){
	var cstMgrId = $("#cstMgrId").val();
	if(StringUtils.isEmpty(cstMgrId))return;
	Add_navTab('tab_re_mgr_prj','项目列表','<%=path%>/project/prjbscinfo/toPrjBscInfoListPage.do?cstMgrId='+cstMgrId+'&mgrPrjViewFlag=mgrPrjViewFlag');
}
//禁用页面固定字段
function disableFixedFiled(){
	//disabledRgnProvCd();//禁用区域
	if(liger.get("isNew")){
		liger.get("isNew").setDisabled(true);
	}
	if(liger.get("preLoanRiskFlagCd")){
		liger.get("preLoanRiskFlagCd").setDisabled(true);
	}
	if(liger.get("localOrNo")){
		liger.get("localOrNo").setDisabled(true);
	}
	if(liger.get("industryTypeCd")){
		liger.get("industryTypeCd").setDisabled(true);
	}
	$("#cstOpn").setDisabled_ligerTextarea(true);
	$("#guaOpn").setDisabled_ligerTextarea(true);
	$("#ugRlOpn").setDisabled_ligerTextarea(true);
	$("#houseCret").setDisabled_ligerTextarea(true);
	$("#companyDetail").setDisabled_ligerTextarea(true);
	$("#financialState").setDisabled_ligerTextarea(true);
	$("#tripartite").setDisabled_ligerTextarea(true);
	$("#wasteBook").setDisabled_ligerTextarea(true);
	$("#otherInfo").setDisabled_ligerTextarea(true);
	$("#riskOpn").setDisabled_ligerTextarea(true);
}
<%-- function toSendCredit(){
	var wait_dialog;
    $.ajax({
		type: 'post',
		dataType:'json',
		url: '<%=path%>/capital/capPayInfo/sendCredit.do?prjId=${projectId}',
		beforeSend: function(){
	          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
	     },
		success:function(msg){
			 wait_dialog.close();
			 if(msg.success == 1){
				 //top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
				 UIUtils.alertSuccessHold1(msg.info);
				 window.location.reload();
			 }else{
				 //top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
				 UIUtils.alertErrorHold1(msg.info);
			 }
		}
	});
} --%>
function submitCredit(){
	var wait_dialog;
    $.ajax({
		type: 'post',
		dataType:'json',
		url: '<%=path%>/project/audit/submitCredit.do?prjId=${projectId}',
		beforeSend: function(){
	          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
	     },
		success:function(msg){
			 wait_dialog.close();
			 if(msg.success == 1){
				 UIUtils.alertSuccessHold1(msg.info);
				 window.location.reload();
			 }else{
				 UIUtils.alertErrorHold1(msg.info);
			 }
		}
	});
}
</script>
</body>
</html>